package com.smartleanx.module.hrm.dal.mysql.contracttype;

import java.util.*;

import com.smartleanx.framework.common.pojo.PageResult;
import com.smartleanx.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.smartleanx.framework.mybatis.core.mapper.BaseMapperX;
import com.smartleanx.module.hrm.dal.dataobject.contracttype.ContractTypeDO;
import org.apache.ibatis.annotations.Mapper;
import com.smartleanx.module.hrm.controller.admin.contracttype.vo.*;

/**
 * 标准合同库分类 Mapper
 *
 * @author 精益大师
 */
@Mapper
public interface ContractTypeMapper extends BaseMapperX<ContractTypeDO> {

    default PageResult<ContractTypeDO> selectPage(ContractTypePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ContractTypeDO>()
                .eqIfPresent(ContractTypeDO::getParentId, reqVO.getParentId())
                .likeIfPresent(ContractTypeDO::getTypeName, reqVO.getTypeName())
                .orderByDesc(ContractTypeDO::getId));
    }
}
